home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / programm.ing / sources.arc / DANG_SRC.LZH / MAINDEF2.H < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-13  |  6.6 KB  |  234 lines

  1. /* last modified : august 8 1993 */
  2. /* note:
  3.      If you want to add more pics. ie add more wall pics. 
  4.      you NEED to check for the line
  5.  
  6.       if(check_for_new_pal > nn) then ...
  7.  
  8.     and change nn to the # of the LAST pic before
  9.     pic#27..(thats MISC3.dat) 
  10.     if you need to , change pick#27 to a higher #.. 
  11.     BUT also remember that you must change the 
  12.     HIT_TABLE array size (currently at a max of 0->27!!)
  13.     and you need to reinit it(its initialized in the 
  14.     module start() in t5.c
  15.  
  16. */
  17.  
  18. /*#define    Random()    (int)xbios(17)         
  19. extern    long    xbios();*/
  20. int hold_xy[8];   /* for other misc pix xy coords */
  21. #define rnd(t) abs(Random()%(t))   /*returns a number from 0 to (t-1) */
  22. int mssg_count=0;
  23. long time=0;  /* timekeeping */
  24. int way=1;   /*time*/
  25. int count=1;weather=0;
  26.                  /* 1st emtry is 1AM */
  27. int change[] = { 000,000,000,000,001,002,004,006,007,047,047,067,077,
  28.                  077,067,057,047,047,037,027,007,006,005,003,001
  29.                 };
  30. static char *weather_list[]={"Normal  ","Windy   ","Cool    ","Hot!    ","Rainy   ","Cold    ","Overcast"};
  31.  
  32. char n[40];
  33.  
  34. char    null[2] = {0,0} ;
  35.  
  36. /* savepal is the sys default pallette. 
  37.    newpal  is the games pallette #1
  38.   
  39.    pal4    is pal      for misc3.dat  (pic25)*/
  40. int savepal[16],newpal[16],junkbuff[46],pal4[16];
  41.  
  42. struct {
  43. unsigned int which_pal : 1;    /* 0 for sys, 1-3 for other */
  44.        } flags;
  45.  
  46. char     temp_[32001],                     /* Temp buffer where file is read in    */
  47.          *hld,
  48.          *iff_in, *iff_out;                  /* Pointers for DEGAS unpack() routine    */
  49.  
  50.  
  51.  
  52. int mode;
  53.  
  54.  
  55.  
  56. /*
  57.     Define VDI Global Variables
  58. */
  59. int contrl[12];
  60. int intin[256],  ptsin[256];
  61. int intout[256], ptsout[256];
  62.  
  63.    int i,filehandle;
  64.     int fd ;
  65.     
  66.     int x,z,w;
  67.     int y;
  68.  
  69.  
  70.  int     handle;     /*  Virtual Workstation Handle   */
  71.   char word[10];
  72.   char title[] ="MAIN.DAT";            /* declares an array that holds the string "MAIN.DAT/0" */ 
  73.     char pix1[]  ="TEMPLATE.DAT";
  74.     char pix2[]  ="ESTABS.DAT";
  75.     char pix3[]  ="GATE.DAT";
  76.     char pix4[]  ="MISC1.DAT";
  77.     char pix5[]  ="MISC2.DAT";
  78.     char pix6[]  ="MISC3.DAT";
  79.   
  80.    
  81.  
  82.   
  83.  
  84. #define max_rooms 250                   /* its 249 rooms right now*/
  85.  
  86. /****************************************************************/
  87. #define max_x 27     /* o to 24  = 25 rooms*/
  88. #define max_y 27      /* 0 to 25   = 26 rooms */ 
  89.  
  90. struct field_data
  91.     {
  92.     int Field1,
  93.         Field2,
  94.         Field3,
  95.         Field4,
  96.         Field5,
  97.         Field6;
  98.     };
  99.  
  100.  struct pic_data
  101.    {
  102.     struct field_data N,
  103.                       S,
  104.                       E,
  105.                       W;
  106.   
  107.    }roomrec[250];
  108.  
  109. struct stuff
  110.        {
  111.        int room;
  112.        int n,s,e,w;
  113.        };
  114.  
  115.        /* if more rooms added make this bigger!!!! (max x and y )*/ 
  116.        /* map[][] uses map[0][0] to map[maxx][maxy] all other arrays
  117.           starts at array[1] */
  118. #define max_x 27     /* o to 24  = 25 rooms*/
  119. #define max_y 27      /* 0 to 25   = 26 rooms */ 
  120.  struct stuff map[max_y][max_x];     /* 2 d array in c is in form a[y][x] */
  121.  
  122.  char dir;
  123.   
  124.    int loc;   
  125.    long command;    
  126.     
  127.  
  128.  
  129.  
  130. char string[30];
  131.     
  132. int runner;
  133. int hrt[20];  /* the hit roll table allocation */
  134. int mhrt[20];  /* the hrt for monsters */
  135.  
  136. struct mon_
  137.         {
  138.         char name[20];
  139.         int ac;
  140.         int hd;
  141.         int hp;
  142.         int weapon;
  143.         int spell;
  144.         int lvl;
  145.         };
  146.  
  147. struct mon_ mon;  /* storage for the data of the monster you are fighting*/
  148.  
  149. struct mon_ monsters[51];  /* 0->50 monsters */ 
  150.  
  151.   /* stores the monsters, its an array of records!*/
  152.   /* to access hp. --->  MONSTERs[2].hp = xxx; */
  153.  
  154.  
  155. struct character
  156.         {
  157.          char name[15]; /* NO! Set these to char *name and then */
  158.          char align[15]; /* name = "blahh.." OR do char name[]="blah!" */
  159.          char class[15];  /* you're defining an array of one element */
  160.          int lvl;         /* thats a ptr to a char! too redundant! */
  161.          long int exp;
  162.          long int hp;
  163.          int ac,str,inte,wis,dex,con;
  164.          int weapon_num,armor_num;
  165.          int backpack[10];       /* holds unique #. I'll have 1 main array that will hold number,name so we can look it up */
  166.          char weapon[15];
  167.          char armor[15];
  168.          char spell[15];
  169.          long int max_hp,max_sp;
  170.          int spell_num;
  171.          long int sp;
  172.          long int gold;
  173.          int user_items[25];  /* holds food,h2o,keys,etc.. */
  174.          int current_spells_active[5]; /*0=treasure Finding, 1=Fleetness, 2=Protection
  175.                                          3=Strength 4=Charm */
  176.          int hunger_thurst_status[2];  /*0 not hungry/thirsty.. 10 FAMISHED */
  177.                                        /* 0 is hunger 1 is thirst */
  178.          long int bank_balance;  
  179.          int x_loc,y_loc,        /* current x,y location */
  180.              weather,count,way,time,loc,current_sky,
  181.              current_sound,clock,am_pm,sound;
  182.          char dir; 
  183.          };
  184.  
  185.  
  186.  struct character user;
  187.  
  188.    
  189.  int who_goes,mon_alive,char_alive,mon_num,mon_lvl;
  190.  
  191.  MFDB t_mf;
  192.  
  193. /* hit table declrations. */
  194. struct vm_table
  195.        {
  196.          int loaded;
  197.          int pix_lookup_cell;
  198.        };
  199. struct vm_table hit_table[31];   /* for virtual memory hit table[1] stands for pic
  200.                         1. If table[1] = 1 then pic 1 is in memory. If
  201.                         its =0 then its not in memory so a pic must be removed, and this 
  202.                         pic must be loaded into its place */
  203.  
  204. #define max_items 50      /* back pack lookup data structs */
  205. struct i_look
  206.        {
  207.         char name[15];
  208.         int points;          /*pts damage for this weapon */
  209.        }unique_item[max_items];
  210.  
  211. /* define street array */
  212. struct street_def
  213.      {
  214.       char street_name[15];  /*14 chars max! */
  215.       int  room;
  216.      }intersection[40];
  217. char street_hold[15];  /* hold streetname so after encounter,etc you*/
  218.                        /* can redisplay the street name  */
  219.  
  220. /* for sound invokage */
  221. long addr;                             /* Basepage addr of TSR prg */
  222.  
  223. int CURRENT_CLOUD;
  224. int CURRENT_SKY=0;       /* holds current value of sky color */
  225. int CURRENT_SOUND=0;     /* if 1-wind, 4-Rain, else no sound */
  226.  
  227. /* SOME TIME DEFS */ /* Initial time is 1pm in the afternoon */
  228. int clock=1;   /* when == 12 a clock tolls , also tells time of day */
  229. int am_pm=1;   /* if == 1 then its pm. at midnight change to am, at noon change to pm */
  230.  
  231. int cell = 0; /* the current room you are in */
  232.  
  233. int sound = 1; /* to turn sound on/off. default is ON */
  234.